﻿using System;
using System.Collections.Generic;
using System.Text;
using FileDownloader;
using System.IO;


namespace WindowsSevicer
{
    public class FileDownload : Downloader
    {
        string url;
        public override string Download(string toDirectory, string url)
        {
            this.url = url;
            string result = base.Download(toDirectory, url);
            UnzipAndDeleted unzipAction = new UnzipAndDeleted();
            string toPath = toDirectory + Path.GetFileName(url);
            unzipAction.unzipTo(toPath);        
            return result;
        }
        public string GetfileName() {
            return Path.GetFileName(url);
        }
    }
}
